package ru.urfc.portal.security;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "user_")
public class PortalUser {
	
	@Id
	private long userid;
	
	private String emailaddress;
	
	@ManyToMany
	@JoinTable(name = "users_roles", joinColumns = {@JoinColumn(name = "userid")}, inverseJoinColumns = {@JoinColumn(name = "roleid")})
	private Set<PortalRole> roles;
	
	public String getEmailaddress() {
		return emailaddress;
	}
	
	public long getUserid() {
		return userid;
	}
	
	public Set<PortalRole> getRoles() {
		return roles;
	}
	
}
